<script type="text/javascript">
        $(document).ready(function() {
            $(".divTeam").click(function(){
                $.ajax({
                    url: "<?php echo URL; ?>picks/setpicks",
                    type: "post",
                    data: "Picked="+this.id,
                    error: function(){
                        alert("theres an error with AJAX");
                    }
                });
                        
                //Check if attribute is set , means ist possible to change Pick
                if($(this).attr("id"))
                {
                    //Get Info from id that called the function
                    var ArrayStr = $(this).attr("id").split("_");
                    if(ArrayStr[3] == "A")
                        OppositeStr = "B";
                    else
                        OppositeStr = "A";
                    var PickedId = "\#idPickSymbol_"  +ArrayStr[3]+"_"+ArrayStr[5];    
                    var UnPickedId = "\#idPickSymbol_"+OppositeStr+"_"+ArrayStr[5];
                        
                    //Change symbols
                    $(PickedId).attr("src", "<?php echo URL ?>public/image/goldmedal.png");
                    $(UnPickedId).attr("src", "<?php echo URL ?>public/image/nomedal.png");
                }
            });

            $( ".divTeam" ).disableSelection();
        });
    </script>
